home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / tabs.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  9.0 KB  |  241 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1998 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'Tabs.pas' rev: 3.00
  6.  
  7. #ifndef TabsHPP
  8. #define TabsHPP
  9. #include <Menus.hpp>
  10. #include <Messages.hpp>
  11. #include <Controls.hpp>
  12. #include <Forms.hpp>
  13. #include <Graphics.hpp>
  14. #include <Classes.hpp>
  15. #include <Windows.hpp>
  16. #include <SysInit.hpp>
  17. #include <System.hpp>
  18.  
  19. //-- user supplied -----------------------------------------------------------
  20.  
  21. namespace Tabs
  22. {
  23. //-- type declarations -------------------------------------------------------
  24. enum TScrollBtn { sbLeft, sbRight };
  25.  
  26. class DELPHICLASS TScroller;
  27. class PASCALIMPLEMENTATION TScroller : public Controls::TCustomControl 
  28. {
  29.     typedef Controls::TCustomControl inherited;
  30.     
  31. private:
  32.     int FMin;
  33.     int FMax;
  34.     int FPosition;
  35.     Classes::TNotifyEvent FOnClick;
  36.     int FChange;
  37.     Graphics::TBitmap* Bitmap;
  38.     bool Pressed;
  39.     bool Down;
  40.     TScrollBtn Current;
  41.     int pWidth;
  42.     int pHeight;
  43.     void __fastcall SetMin(int Value);
  44.     void __fastcall SetMax(int Value);
  45.     void __fastcall SetPosition(int Value);
  46.     bool __fastcall CanScrollLeft(void);
  47.     bool __fastcall CanScrollRight(void);
  48.     HIDESBASE void __fastcall DoMouseDown(int X);
  49.     HIDESBASE MESSAGE void __fastcall WMLButtonDown(Messages::TWMMouse &Message);
  50.     HIDESBASE MESSAGE void __fastcall WMLButtonDblClk(Messages::TWMMouse &Message);
  51.     HIDESBASE MESSAGE void __fastcall WMMouseMove(Messages::TWMMouse &Message);
  52.     HIDESBASE MESSAGE void __fastcall WMLButtonUp(Messages::TWMMouse &Message);
  53.     HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
  54.     
  55. public:
  56.     __fastcall virtual TScroller(Classes::TComponent* AOwner);
  57.     __fastcall virtual ~TScroller(void);
  58.     virtual void __fastcall Paint(void);
  59.     
  60. __published:
  61.     __property Classes::TNotifyEvent OnClick = {read=FOnClick, write=FOnClick};
  62.     __property int Min = {read=FMin, write=SetMin, default=0};
  63.     __property int Max = {read=FMax, write=SetMax, default=0};
  64.     __property int Position = {read=FPosition, write=SetPosition, default=0};
  65.     __property int Change = {read=FChange, write=FChange, default=1};
  66. public:
  67.     /* TWinControl.CreateParented */ __fastcall TScroller(HWND ParentWindow) : Controls::TCustomControl(
  68.         ParentWindow) { }
  69.     
  70. };
  71.  
  72. class DELPHICLASS TTabList;
  73. class DELPHICLASS TTabSet;
  74. enum TTabStyle { tsStandard, tsOwnerDraw };
  75.  
  76. typedef void __fastcall (__closure *TMeasureTabEvent)(System::TObject* Sender, int Index, int &TabWidth
  77.     );
  78.  
  79. typedef void __fastcall (__closure *TDrawTabEvent)(System::TObject* Sender, Graphics::TCanvas* TabCanvas
  80.     , const Windows::TRect &R, int Index, bool Selected);
  81.  
  82. typedef void __fastcall (__closure *TTabChangeEvent)(System::TObject* Sender, int NewTab, bool &AllowChange
  83.     );
  84.  
  85. enum TEdgeType { etNone, etFirstIsSel, etFirstNotSel, etLastIsSel, etLastNotSel, etNotSelToSel, etSelToNotSel, 
  86.     etNotSelToNotSel };
  87.  
  88. class PASCALIMPLEMENTATION TTabSet : public Controls::TCustomControl 
  89. {
  90.     typedef Controls::TCustomControl inherited;
  91.     
  92. private:
  93.     int FStartMargin;
  94.     int FEndMargin;
  95.     Classes::TStrings* FTabs;
  96.     int FTabIndex;
  97.     int FFirstIndex;
  98.     int FVisibleTabs;
  99.     Graphics::TColor FSelectedColor;
  100.     Graphics::TColor FUnselectedColor;
  101.     Graphics::TColor FBackgroundColor;
  102.     bool FDitherBackground;
  103.     bool FAutoScroll;
  104.     TTabStyle FStyle;
  105.     int FOwnerDrawHeight;
  106.     TMeasureTabEvent FOnMeasureTab;
  107.     TDrawTabEvent FOnDrawTab;
  108.     TTabChangeEvent FOnChange;
  109.     Controls::TImageList* ImageList;
  110.     Graphics::TBitmap* MemBitmap;
  111.     Graphics::TBitmap* BrushBitmap;
  112.     Classes::TList* TabPositions;
  113.     int FTabHeight;
  114.     TScroller* Scroller;
  115.     bool FDoFix;
  116.     void __fastcall SetSelectedColor(Graphics::TColor Value);
  117.     void __fastcall SetUnselectedColor(Graphics::TColor Value);
  118.     void __fastcall SetBackgroundColor(Graphics::TColor Value);
  119.     void __fastcall SetDitherBackground(bool Value);
  120.     void __fastcall SetAutoScroll(bool Value);
  121.     void __fastcall SetStartMargin(int Value);
  122.     void __fastcall SetEndMargin(int Value);
  123.     void __fastcall SetTabIndex(int Value);
  124.     void __fastcall SetFirstIndex(int Value);
  125.     void __fastcall SetTabList(Classes::TStrings* Value);
  126.     void __fastcall SetTabStyle(TTabStyle Value);
  127.     void __fastcall SetTabHeight(int Value);
  128.     HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
  129.     HIDESBASE MESSAGE void __fastcall CMSysColorChange(Messages::TMessage &Message);
  130.     HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
  131.     void __fastcall PaintEdge(int X, int Y, int H, TEdgeType Edge);
  132.     void __fastcall CreateBrushPattern(Graphics::TBitmap* Bitmap);
  133.     int __fastcall CalcTabPositions(int Start, int Stop, Graphics::TCanvas* Canvas, int First);
  134.     void __fastcall CreateScroller(void);
  135.     void __fastcall InitBitmaps(void);
  136.     void __fastcall DoneBitmaps(void);
  137.     void __fastcall CreateEdgeParts(void);
  138.     void __fastcall FixTabPos(void);
  139.     MESSAGE void __fastcall WMGetDlgCode(Messages::TWMNoParams &Message);
  140.     HIDESBASE MESSAGE void __fastcall CMDialogChar(Messages::TWMKey &Message);
  141.     void __fastcall ScrollClick(System::TObject* Sender);
  142.     void __fastcall ReadIntData(Classes::TReader* Reader);
  143.     void __fastcall ReadBoolData(Classes::TReader* Reader);
  144.     
  145. protected:
  146.     virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
  147.     DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, 
  148.         int Y);
  149.     virtual void __fastcall Paint(void);
  150.     virtual void __fastcall DrawTab(Graphics::TCanvas* TabCanvas, const Windows::TRect &R, int Index, bool 
  151.         Selected);
  152.     bool __fastcall CanChange(int NewIndex);
  153.     DYNAMIC void __fastcall GetChildren(Classes::TGetChildProc Proc, Classes::TComponent* Root);
  154.     virtual void __fastcall MeasureTab(int Index, int &TabWidth);
  155.     virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
  156.     
  157. public:
  158.     __fastcall virtual TTabSet(Classes::TComponent* AOwner);
  159.     __fastcall virtual ~TTabSet(void);
  160.     int __fastcall ItemAtPos(const tagPOINT &Pos);
  161.     Windows::TRect __fastcall ItemRect(int Item);
  162.     HIDESBASE void __fastcall SelectNext(bool Direction);
  163.     __property Canvas ;
  164.     __property int FirstIndex = {read=FFirstIndex, write=SetFirstIndex, default=0};
  165.     
  166. __published:
  167.     __property Align ;
  168.     __property bool AutoScroll = {read=FAutoScroll, write=SetAutoScroll, default=1};
  169.     __property Graphics::TColor BackgroundColor = {read=FBackgroundColor, write=SetBackgroundColor, default=-2147483633
  170.         };
  171.     __property bool DitherBackground = {read=FDitherBackground, write=SetDitherBackground, default=1};
  172.     __property DragMode ;
  173.     __property Enabled ;
  174.     __property int EndMargin = {read=FEndMargin, write=SetEndMargin, default=5};
  175.     __property Font ;
  176.     __property ParentShowHint ;
  177.     __property PopupMenu ;
  178.     __property ShowHint ;
  179.     __property int StartMargin = {read=FStartMargin, write=SetStartMargin, default=5};
  180.     __property Graphics::TColor SelectedColor = {read=FSelectedColor, write=SetSelectedColor, default=-2147483633
  181.         };
  182.     __property TTabStyle Style = {read=FStyle, write=SetTabStyle, default=0};
  183.     __property int TabHeight = {read=FOwnerDrawHeight, write=SetTabHeight, default=20};
  184.     __property Classes::TStrings* Tabs = {read=FTabs, write=SetTabList};
  185.     __property int TabIndex = {read=FTabIndex, write=SetTabIndex, default=-1};
  186.     __property Graphics::TColor UnselectedColor = {read=FUnselectedColor, write=SetUnselectedColor, default=-2147483643
  187.         };
  188.     __property Visible ;
  189.     __property int VisibleTabs = {read=FVisibleTabs, nodefault};
  190.     __property OnClick ;
  191.     __property TTabChangeEvent OnChange = {read=FOnChange, write=FOnChange};
  192.     __property OnDragDrop ;
  193.     __property OnDragOver ;
  194.     __property TDrawTabEvent OnDrawTab = {read=FOnDrawTab, write=FOnDrawTab};
  195.     __property OnEndDrag ;
  196.     __property OnEnter ;
  197.     __property OnExit ;
  198.     __property OnMouseDown ;
  199.     __property OnMouseMove ;
  200.     __property OnMouseUp ;
  201.     __property TMeasureTabEvent OnMeasureTab = {read=FOnMeasureTab, write=FOnMeasureTab};
  202.     __property OnStartDrag ;
  203. public:
  204.     /* TWinControl.CreateParented */ __fastcall TTabSet(HWND ParentWindow) : Controls::TCustomControl(ParentWindow
  205.         ) { }
  206.     
  207. };
  208.  
  209. class PASCALIMPLEMENTATION TTabList : public Classes::TStringList 
  210. {
  211.     typedef Classes::TStringList inherited;
  212.     
  213. private:
  214.     TTabSet* Tabs;
  215.     
  216. public:
  217.     virtual void __fastcall Insert(int Index, const System::AnsiString S);
  218.     virtual void __fastcall Delete(int Index);
  219.     virtual int __fastcall Add(const System::AnsiString S);
  220.     virtual void __fastcall Put(int Index, const System::AnsiString S);
  221.     virtual void __fastcall Clear(void);
  222.     virtual void __fastcall AddStrings(Classes::TStrings* Strings);
  223. public:
  224.     /* TStringList.Destroy */ __fastcall virtual ~TTabList(void) { }
  225.     
  226. public:
  227.     /* TObject.Create */ __fastcall TTabList(void) : Classes::TStringList() { }
  228.     
  229. };
  230.  
  231. enum TEdgePart { epSelectedLeft, epUnselectedLeft, epSelectedRight, epUnselectedRight };
  232.  
  233. //-- var, const, procedure ---------------------------------------------------
  234.  
  235. }    /* namespace Tabs */
  236. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  237. using namespace Tabs;
  238. #endif
  239. //-- end unit ----------------------------------------------------------------
  240. #endif    // Tabs
  241.